var app = getApp();

Component
({
    data: 
    {
        images: '', // 静态图片地址
        tipStatus: false,
        modalSlide: false,
    },

    options: 
    {
        multipleSlots: true // 具名插槽需申明
    },

    properties: 
    {
        show: 
        {
            type: Boolean,
            value: false,

            // 监听父组件传入值变化
            observer(newVal)
            {   
                if (newVal && newVal != this.data.tipStatus)
                {   
                    this.setData({ tipStatus: true })

                    setTimeout(() => 
                    {
                        this.setData({ modalSlide: true })
                    }, 50)
                }
                else
                {
                    this.setData({ modalSlide: false });

                    setTimeout(() =>
                    {
                        this.setData({ tipStatus: false })
                    }, 100)
                }
            }
        },
        // 弹窗默认高度
        height: 
        {
            type: String,
            value: 650
        },
        isShowClose:{
            type: Boolean,
            value: true
        },

    },

    ready() 
    {
        // console.log(this.properties.empty)
    },

    methods: 
    {
        // 关闭
        onClose()
        {
            this.setData({ modalSlide: false });

            setTimeout(() => 
            {
                this.setData({ tipStatus: false })
            }, 100)

            let popup = 
            {
                show: false,
                type: 0
            }

            this.triggerEvent('change', popup.show);
        },
        
        onConfirm()
        {
            this.setData({ modalSlide: false });

            setTimeout(() => {
                this.setData({ tipStatus: false })
            }, 100)

            let popup =
            {
                show: true,
                type: 1
            }

            this.triggerEvent('change', popup);
        }
    }
})